package com.ljf.authority.dto.command;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.ljf.common.validation.AddGroup;
import com.ljf.common.validation.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 菜单列表定义--新增修改  authority_base_menu_tabulation
 *
 * @author LJF
 * @since 2024-10-17
 */
@Data
@ApiModel("菜单列表定义--新增修改")
public class AuthorityBaseMenuTabulationCommand implements Serializable {

    @JsonProperty("id")
    @ApiModelProperty(value = "ID")
    @NotNull(message = "ID不能为空", groups = {UpdateGroup.class})
    private Long id;

    @JsonProperty("pCode")
    @ApiModelProperty(value = "上级编码")
    private String pCode;

    @JsonProperty("code")
    @ApiModelProperty(value = "编码")
    @NotEmpty(message = "编码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String code;

    @JsonProperty("label")
    @ApiModelProperty(value = "标签")
    @Length(message = "标签不能超过10个字符", max = 10)
    @NotEmpty(message = "标签不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String label;

}
